package a.g;

import a.c.d;
import a.f.l.c;
import a.f.l.i;
import a.f.rc;
import a.h.cc;
import a.h.dc;
import a.h.jc;
import a.h.z;
import a.i.p;
import a.j.g;

public class j
  extends h
{
  private static final String q = "CHANNEL_EDGE_ROUTER";
  private c r;
  private static final String s = "PATHFINDER";
  private static final String t = "SCOPE";
  private static final String u = "SCOPE_AT_SELECTED_NODES";
  private static final String v = "SCOPE_SELECTED_EDGES";
  private static final String w = "LAYOUT_OPTIONS";
  private static final String x = "SCOPE_ALL_EDGES";
  private static final String y = "COST";
  private static final String z = "EDGE_CROSSING_COST";
  private static final String A = "NODE_CROSSING_COST";
  private static final String B = "BEND_COST_FACTOR";
  private static final String C = "MINIMUM_DISTANCE";
  private static final String D = "ACTIVATE_GRID_ROUTING";
  private static final String E = "GRID_SPACING";
  private static final String F = "ORTHOGONAL_PATTERN_PATH_FINDER";
  private static final String G = "ORTHOGONAL_SHORTESTPATH_PATH_FINDER";
  public static boolean H;
  
  public j()
  {
    super("CHANNEL_EDGE_ROUTER", "yFiles Layout Team", "Routes edges orthogonally.");
    d(true);
  }
  
  protected void m()
  {
    int i = f.p;
    boolean bool = f.o;
    z();
    b(this.r);
    g localg = e();
    dc localdc = i();
    if (i == 0) {
      if (localdc.j("SCOPE").equals("SCOPE_ALL_EDGES"))
      {
        localg.a(c.g, new p()
        {
          public boolean getBool(Object paramAnonymousObject)
          {
            return true;
          }
        });
        if ((i == 0) && (!bool)) {
          return;
        }
      }
    }
    if (i == 0)
    {
      if (localdc.j("SCOPE").equals("SCOPE_SELECTED_EDGES"))
      {
        if (i != 0) {
          break label122;
        }
        localg.a(c.g, new p()
        {
          private final g val$graph;
          
          public boolean getBool(Object paramAnonymousObject)
          {
            return this.val$graph.v((d)paramAnonymousObject);
          }
        });
      }
    }
    else if (!bool) {
      return;
    }
    label122:
    localg.a(c.g, new p()
    {
      private final g val$graph;
      
      public boolean getBool(Object paramAnonymousObject)
      {
        int i = f.p;
        if (i == 0) {
          if (!this.val$graph.y(((d)paramAnonymousObject).e())) {
            if (i != 0) {
              break label47;
            }
          }
        }
        label47:
        return this.val$graph.y(((d)paramAnonymousObject).f());
      }
    });
  }
  
  private void z()
  {
    if (f.p == 0) {
      if (this.r != null) {
        return;
      }
    }
    this.r = new c();
  }
  
  public void b(rc paramrc)
  {
    int i = f.p;
    boolean bool = f.o;
    if ((i != 0) || ((paramrc instanceof c)))
    {
      c localc = (c)paramrc;
      dc localdc = i();
      Object localObject1;
      if (localdc.j("PATHFINDER").equals("ORTHOGONAL_PATTERN_PATH_FINDER"))
      {
        localObject2 = new a.f.l.h();
        ((a.f.l.h)localObject2).a(c.g);
        ((a.f.l.h)localObject2).a(localdc.f("MINIMUM_DISTANCE"));
        ((a.f.l.h)localObject2).a(localdc.g("ACTIVATE_GRID_ROUTING"));
        ((a.f.l.h)localObject2).b(localdc.f("GRID_SPACING"));
        ((a.f.l.h)localObject2).e(localdc.f("BEND_COST_FACTOR"));
        ((a.f.l.h)localObject2).c(localdc.f("EDGE_CROSSING_COST"));
        ((a.f.l.h)localObject2).d(localdc.f("NODE_CROSSING_COST"));
        ((a.f.l.h)localObject2).f(0.0D);
        localObject1 = localObject2;
        if (i != 0) {
          break label222;
        }
        if (!bool) {}
      }
      else
      {
        localObject2 = new c.a_();
        ((c.a_)localObject2).c(c.g);
        ((c.a_)localObject2).c((int)localdc.f("MINIMUM_DISTANCE"));
        ((c.a_)localObject2).d(localdc.g("ACTIVATE_GRID_ROUTING"));
        ((c.a_)localObject2).b((int)localdc.f("GRID_SPACING"));
        ((c.a_)localObject2).b(localdc.f("EDGE_CROSSING_COST"));
        localObject1 = localObject2;
      }
      localc.b(localObject1);
      label222:
      Object localObject2 = new i();
      ((i)localObject2).a(c.g);
      ((i)localObject2).b(localdc.f("MINIMUM_DISTANCE"));
      ((i)localObject2).c(localdc.g("ACTIVATE_GRID_ROUTING"));
      ((i)localObject2).a(localdc.f("GRID_SPACING"));
      localc.c((rc)localObject2);
      if (!bool) {}
    }
    else
    {
      throw new IllegalArgumentException("argument must be of type y.layout.router.ChannelEdgeRouter");
    }
  }
  
  public void c(rc paramrc)
  {
    dc localdc = i();
    a(localdc, paramrc);
  }
  
  void a(dc paramdc, rc paramrc)
  {
    int i = f.p;
    boolean bool = f.o;
    paramdc.g();
    if ((i != 0) || (paramrc != null))
    {
      if (i != 0) {
        break label44;
      }
      if ((paramrc instanceof c)) {}
    }
    else
    {
      paramrc = new c();
    }
    label44:
    c localc = (c)paramrc;
    cc localcc = new cc();
    localcc.a("OptionGroup.title", "LAYOUT_OPTIONS");
    String[] arrayOfString = { "ORTHOGONAL_PATTERN_PATH_FINDER", "ORTHOGONAL_SHORTESTPATH_PATH_FINDER" };
    z localz;
    if (i == 0) {
      if ((localc.b() instanceof a.f.l.h))
      {
        localObject1 = (a.f.l.h)localc.b();
        localcc.a(paramdc.a("PATHFINDER", arrayOfString, 0));
        localObject2 = new String[] { "SCOPE_ALL_EDGES", "SCOPE_SELECTED_EDGES", "SCOPE_AT_SELECTED_NODES" };
        localcc.a(paramdc.a("SCOPE", (Object[])localObject2, 0));
        localcc.a(paramdc.a("MINIMUM_DISTANCE", ((a.f.l.h)localObject1).f()));
        localcc.a(paramdc.a("ACTIVATE_GRID_ROUTING", ((a.f.l.h)localObject1).i()));
        localcc.a(paramdc.a("GRID_SPACING", ((a.f.l.h)localObject1).g()));
        paramdc.k("GRID_SPACING").a(jc.y, new Double(2.0D));
        localz = new z(paramdc);
        localz.a("ACTIVATE_GRID_ROUTING", Boolean.TRUE, "GRID_SPACING");
        localcc = new cc();
        localcc.a("OptionGroup.title", "COST");
        localcc.a(paramdc.a("BEND_COST_FACTOR", ((a.f.l.h)localObject1).l()));
        localz.a("PATHFINDER", "ORTHOGONAL_PATTERN_PATH_FINDER", "BEND_COST_FACTOR");
        localcc.a(paramdc.a("EDGE_CROSSING_COST", ((a.f.l.h)localObject1).j()));
        localz.a("PATHFINDER", "ORTHOGONAL_PATTERN_PATH_FINDER", "EDGE_CROSSING_COST");
        localcc.a(paramdc.a("NODE_CROSSING_COST", ((a.f.l.h)localObject1).k()));
        localz.a("PATHFINDER", "ORTHOGONAL_PATTERN_PATH_FINDER", "NODE_CROSSING_COST");
        if ((i == 0) && (!bool)) {
          return;
        }
      }
    }
    if (i == 0) {
      if ((localc.b() instanceof c.a_))
      {
        localObject1 = (c.a_)localc.b();
        localcc.a(paramdc.a("PATHFINDER", arrayOfString, 1));
        localObject2 = new String[] { "SCOPE_ALL_EDGES", "SCOPE_SELECTED_EDGES", "SCOPE_AT_SELECTED_NODES" };
        localcc.a(paramdc.a("SCOPE", (Object[])localObject2, 0));
        localcc.a(paramdc.a("MINIMUM_DISTANCE", ((c.a_)localObject1).K()));
        paramdc.k("MINIMUM_DISTANCE").a(jc.y, new Double(4.0D));
        localcc.a(paramdc.a("ACTIVATE_GRID_ROUTING", ((c.a_)localObject1).H()));
        localcc.a(paramdc.a("GRID_SPACING", ((c.a_)localObject1).J()));
        paramdc.k("GRID_SPACING").a(jc.y, new Double(2.0D));
        localz = new z(paramdc);
        localz.a("ACTIVATE_GRID_ROUTING", Boolean.TRUE, "GRID_SPACING");
        localcc = new cc();
        localcc.a("OptionGroup.title", "COST");
        localcc.a(paramdc.a("BEND_COST_FACTOR", 1.0D));
        localz.a("PATHFINDER", "ORTHOGONAL_PATTERN_PATH_FINDER", "BEND_COST_FACTOR");
        localcc.a(paramdc.a("EDGE_CROSSING_COST", 5.0D));
        localz.a("PATHFINDER", "ORTHOGONAL_PATTERN_PATH_FINDER", "EDGE_CROSSING_COST");
        localcc.a(paramdc.a("NODE_CROSSING_COST", 50.0D));
        localz.a("PATHFINDER", "ORTHOGONAL_PATTERN_PATH_FINDER", "NODE_CROSSING_COST");
        if (i == 0) {
          if (!bool) {
            return;
          }
        }
      }
      else
      {
        localcc.a(paramdc.a("PATHFINDER", arrayOfString, 0));
      }
    }
    Object localObject1 = { "SCOPE_ALL_EDGES", "SCOPE_SELECTED_EDGES", "SCOPE_AT_SELECTED_NODES" };
    localcc.a(paramdc.a("SCOPE", (Object[])localObject1, 0));
    localcc.a(paramdc.a("MINIMUM_DISTANCE", 10.0D));
    localcc.a(paramdc.a("ACTIVATE_GRID_ROUTING", true));
    localcc.a(paramdc.a("GRID_SPACING", 20.0D));
    Object localObject2 = new z(paramdc);
    ((z)localObject2).a("ACTIVATE_GRID_ROUTING", Boolean.TRUE, "GRID_SPACING");
    localcc = new cc();
    localcc.a("OptionGroup.title", "COST");
    localcc.a(paramdc.a("BEND_COST_FACTOR", 1.0D));
    ((z)localObject2).a("PATHFINDER", "ORTHOGONAL_PATTERN_PATH_FINDER", "BEND_COST_FACTOR");
    localcc.a(paramdc.a("EDGE_CROSSING_COST", 5.0D));
    ((z)localObject2).a("PATHFINDER", "ORTHOGONAL_PATTERN_PATH_FINDER", "EDGE_CROSSING_COST");
    localcc.a(paramdc.a("NODE_CROSSING_COST", 50.0D));
    ((z)localObject2).a("PATHFINDER", "ORTHOGONAL_PATTERN_PATH_FINDER", "NODE_CROSSING_COST");
  }
  
  protected void o()
  {
    this.r = null;
  }
  
  protected dc j()
  {
    dc localdc = new dc(a());
    a(localdc, null);
    return localdc;
  }
  
  protected void n()
  {
    a(this.r);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.g.j

 * JD-Core Version:    0.7.0.1

 */